﻿#ifndef DEFINE_TICKET_T_H
#define DEFINE_TICKET_T_H

#pragma pack(1)
//为取名称统一函数加的类型
#define  SEARCH_UNIT_TYPE_NAME  1
#define  SEARCH_SEQ_TYPE_NAME   2
#define  SEARCH_UNIT_JX_TYPE_NAME    3



enum SEQ_TICKET_EDIT_COLUMN
{
	EDIT_COLUMN_XUHAO            =0,	//
	EDIT_COLUMN_DZ_TYPE           ,		//
	EDIT_COLUMN_DZ_OBJECT         ,		//
	EDIT_COLUMN_DZ_ATTRUBUTE      ,		//
	EDIT_COLUMN_CONTENT           ,		//
	EDIT_COLUMN_DSP               ,		//
	EDIT_COLUMN_EXE_RULE          ,		//
	EDIT_COLUMN_CONFIG            ,		//
	EDIT_COLUMN_ERROR_TYPE        ,		//
	EDIT_COLUMN_TIME_DELAY        ,		//
	EDIT_COLUMN_TIME_OUT          ,
	EDIT_COLUMN_SETAREA
};
//设备状态定义表、顺控操作确认、出错遥信处理方式代理区分
#define  DELETE_TYPE_DEVSTATE    1
#define  DELETE_TYPE_UNIT_TYPE    2
#define  DELETE_TYPE_SEQ_CONFIG  3
#define  DELETE_TYPE_ERRORYX_DEL 4



typedef struct _rYxDefine_Connect
{
	XUSHORT       IndexNo;									//点号
	XCHAR         Name[STRING_NORMAL_LEN];					//名称
	_rYxDefine_Connect()
	{
		IndexNo=0;
		memset(Name, 0,STRING_NORMAL_LEN);
	}
	~_rYxDefine_Connect()
	{		
	}
}rYxDefine_Connect,rYcDefine_Connect,rYkDefine_Connect,rYtDefine_Connect,rYmDefine_Connect;										  

// typedef struct _s_d_
// {
// 	char*   sname;// 显示名称
// 	int     data; // 关联ITEMDATA 或 Qtablewidget 宽度
// }s_d;
// 


//是否允许
#define ISENABLE_UNABLE									0x0
#define ISENABLE_ABLE									0x1


//
////逆波兰
//#define   MS    100
//typedef struct _SqStack 
//{ 
//	char *base; 
//	char *top; 
//	char stacksize; 
//}SqStack;
//




//typedef struct _UNIT_JX_TYPE_SET					   
//{
//	int      unit_type;                               
//	int      unit_jx_type;                             
//	_UNIT_JX_TYPE_SET()
//	{
//		unit_type=0;
//		unit_jx_type=0;
//	}
//	~_UNIT_JX_TYPE_SET()
//	{
//	}
//}UNIT_JX_TYPE_SET;

#define  TREE_ITEM_ROOT        1000 //偏移



//遥测规则判断
#define WF_YX_RULE_EQUAL                                3
#define	WF_YC_RULE_LESS_0								0
#define	WF_YC_RULE_BIGGER_1								1

//规则项类型
#define   RULE_TYPE_YX         0
#define   RULE_TYPE_YC         1

#define  YiCi_OPER_OFF  0
#define  YiCi_OPER_ON  1

#define   WF_TICKET_BASE            0
#define   WF_ITCKET_REPAIR          1



#define  MODEL_TYPE_DX 1
#define  MODEL_TYPE_SEQ 2




////票库类型
//enum DATA_TICKET_DATEBASE_TYPE
//{
//	TICKET_DB_TYPE_TYPICAL   	       =1,
//	TICKET_DB_TYPE_PRE_SAVE   	       ,
//	TICKET_DB_TYPE_HIS   	           ,
//	TICKET_DB_TYPE_MODEL   	           ,
//	TICKET_DB_TYPE_HAND   	           
//};

enum DATA_TICKET_ENUM
{
	ITEM_ROOT_TYPICAL   	     =1,	    //1
	ITEM_ROOT_PRESAVE   	       ,
	ITEM_ROOT_HIS   	           ,
	ITEM_ROOT_MODEL   	           ,
	ITEM_ROOT_HAND   	           ,

	ITEM_MAIN_UNIT_TYPICAL     ,
	ITEM_MAIN_UNIT_PRE   	   ,
	ITEM_MAIN_UNIT_HIS   	   ,
	ITEM_MAIN_UNIT_MODEL       ,

	ITEM_SUB_UNIT_TYPICAL      ,
	ITEM_SUB_UNIT_PRE   	   ,
	ITEM_SUB_UNIT_HIS  	       ,
	ITEM_SUB_UNIT_MODEL  	   ,

	ITEM_TICKET_TYPICAL  	   ,
	ITEM_TICKET_PRE  	       ,
	ITEM_TICKET_HIS  	       ,
	ITEM_TICKET_MODEL          ,
	ITEM_TICKET_HAND   	   
};  
//典型票和预存票类型
#define BASE_TICKET_TYPE_PRE          0x10 //预存票
#define BASE_TICKET_TYPE_MODEL        0x20 //典型票
#define   RULE_TREE_QUAN       1000000
struct COM_INI
{
	int          m_nDataBits;       
	int          m_nBaud;           
	int          m_nStopbits;       
	int          m_nParity;         
	int          m_nInd;            
	int          m_nFlowCtrl;       
	int          m_nincount;        
	int          m_noutcount;       
	COM_INI()
	{
		m_nInd=1;
		m_nDataBits=0;
		m_nBaud=9600;
		m_nStopbits=0;
		m_nParity=0;
		m_nFlowCtrl=0;
		m_nincount=140;
		m_noutcount=140;
	}
};

//操作类型                    
#define		WF_OPERATE_TYPE_PROMPT					1	//提示项
#define		WF_OPERATE_TYPE_OPERATE_ONE				2	//一次操作项
#define		WF_OPERATE_TYPE_OPERATE_TWO				3	//二次操作项
#define		WF_OPERATE_TYPE_CHECK					4	//检查项
//顺控票扩展
//#define		WF_OPERATE_TYPE_SEQ_SET_SETAREA					5	//检查项
//#define		WF_OPERATE_TYPE_SEQ_CHECK_SETAREA				5	//检查项
//#define		WF_OPERATE_TYPE_SEQ_SET_SETAREA					5	//检查项
//#define		WF_OPERATE_TYPE_SEQ_SET_SETAREA					5	//检查项

#define WF_DEV_ATTRIBUTE_OPERATE_TWO                    0            //二次设备
#define WF_DEV_ATTRIBUTE_OPERATE_DEV                    1            //设备
#define WF_DEV_ATTRIBUTE_OPERATE_YX                     2            //遥信

//五防短语最大长度
#define		WF_MAX_PHRASE_CONTENT_LENGTH			200
//五防任务名称最大长度
#define		WF_MAX_TASK_NAME_LENGTH					200


//开关状态切换
#define   SWITCH_OFF									0
#define   SWITCH_ON										1
#define   SWITCH_UNKONW								2
#define   SWITCH_ERROR								4

//手车状态
#define WF_HAND_SWITCH_TEST								0        //试验
#define WF_HAND_SWITCH_WORK								1        //工作
#define WF_HAND_SWITCH_REPAIR							2        //检修

//手车状态切换
#define WF_HAND_SWITCH_0_1                              1+100        //试验转工作
#define WF_HAND_SWITCH_1_0                              10+100       //工作转试验
#define WF_HAND_SWITCH_0_2                              2+100        //试验转检修
#define WF_HAND_SWITCH_2_0                              20+100       //检修转试验
#define WF_HAND_SWITCH_1_2                              12+100       //工作转检修
#define WF_HAND_SWITCH_2_1                              21+100       //检修转工作

//五防设备类型
#define WF_DEVICE_KIND_REAL_YX							1       //五防实遥信(无)		
#define	WF_DEVICE_KIND_SWITCH					    	2		//开关/断路器
#define	WF_DEVICE_KIND_DAOZHA					    	3		//刀闸/隔离刀闸
#define	WF_DEVICE_KIND_JD_SWITCH					    4		//接地刀闸
#define	WF_DEVICE_KIND_ACTIVE_DX						5		//活动地线
#define	WF_DEVICE_KIND_WANGMENG					        6	    //网门
#define	WF_DEVICE_KIND_HAND_SWITCH					   	7		//手车
#define	WF_DEVICE_KIND_COMMYB					   	    8		//普通压板
#define	WF_DEVICE_KIND_SWITCH_AIR					    9		//空气开关
#define	WF_DEVICE_KIND__FUSION					   	    10		//熔断器
#define	WF_DEVICE_KIND__CHANGE_SWITCH					11		//切换开关
#define	WF_DEVICE_KIND__ERCI_SMALL_SWITCH				12		//二次小开关
#define	WF_DEVICE_KIND__ERCI_SMALL_DAOZHA				13		//二次小刀闸
#define	WF_DEVICE_KIND__DAOZHA_YANDIAN	 		   		14		//接地刀闸验电
#define	WF_DEVICE_KIND__DX_YANDIAN					   	15		//线路侧接地线验电
#define	WF_DEVICE_KIND__JD_SWITCH_YANDIAN	   			16		//中性点接地刀闸
#define	WF_DEVICE_KIND__LOCK_YANDIAN				   	17		//验电锁		
#define	WF_DEVICE_KIND__SPARE5				   			18		
#define	WF_DEVICE_KIND__BAOCHOU				   			19		//把手
#define	WF_DEVICE_KIND__SPARE7				   			20		
#define	WF_DEVICE_KIND__H_MX				   			21		//高压母线
#define	WF_DEVICE_KIND__L_MX				   			22		//低压母线
#define	WF_DEVICE_KIND__TRANSPARENT				   		23		//变压器
#define	WF_DEVICE_KIND__PT				   				24		//电压互感器
#define	WF_DEVICE_KIND__CT				   				25		//电流互感器

//五防钥匙类型
#define		WF_KEY_TYPE_2					0x1		//II型钥匙
#define		WF_KEY_TYPE_3					0x2		//III型钥匙
#define		WF_KEY_TYPE_Contrl				0x6	    //共创26版
#define		WF_KEY_TYPE_ZXWF				0x10	//在线五防


// 类型
#define PROMPT_TYPE_FRONT			0x1		//前提示
#define PROMPT_TYPE_AFTER			0x2		//后提示
#define PROMPT_TYPE_SELECT			0x3		//手动提示
#define PROMPT_TYPE_DEV_OTHER   	0x4		//手动提示-设备相关2011为修改操作术语添加类型
//地线操作 
#define     GROUNDLINE_JIEDI_NO                 0
#define     GROUNDLINE_JIEDI_YES                1



#define LOOKUP_TYPE_FORWORD			0x1		//向前查找
#define LOOKUP_TYPE_BACKWORD		0x2		//向后查找

//五防检测锁配置定义
#define WF_CHECK_TYPE_NONE                              0		//不自动检查锁
#define WF_CHECK_TYPE_PRE                               1		//前检查锁
#define WF_CHECK_TYPE_AFTER                             2		//后检查锁
#define WF_CHECK_TYPE_BOTH								3		//前后检查锁





//五防操作类型
#define		WF_LOCK_KIND_A						'A'	//A型
#define		WF_LOCK_KIND_B						'B'	//B型
#define		WF_LOCK_KIND_C						'C'	//C型
#define		WF_LOCK_KIND_D						'D'	//D型
#define		WF_LOCK_KIND_E						'E'	//E型
#define		WF_LOCK_KIND_F						'F'	//F型
#define		WF_LOCK_KIND_G						'G'	//G型
#define		WF_LOCK_KIND_H						'H'	//H型
#define		WF_LOCK_KIND_I						'I'	//I型
#define		WF_LOCK_KIND_J						'J'	//J型
#define		WF_LOCK_KIND_K						'K'	//K型
#define		WF_LOCK_KIND_L						'L'	//L型
#define		WF_LOCK_KIND_M						'M'	//M型
#define		WF_LOCK_KIND_N						'N'	//N型
#define		WF_LOCK_KIND_Q						'Q'	//Q型
#define		WF_LOCK_KIND_Z						'Z'	//Z型
#define		WF_LOCK_KIND_0						1	//三态锁 (锁型是多少)
#define     WF_LOCK_KIND_CHECK_LOCK             100//检测锁
#define     WF_LOCK_KIND_CHECK_UNLOCK           101//检测锁



typedef struct _STRUCT_SYSTEM_PARA_INFO
{
	COM_INI		com_ini;
	XCHAR		default_file[250];
	bool        wf_Is_wf_fac;
	bool        wfIS_Yangzhou_Model;
	bool		wf_manset_able;
	bool		wf_signboard_able;
	XUCHAR		wf_key_type;
	bool        wf_task_Only;
	bool        wf_Prompt_DownKey;
	bool        wf_Is_Limit_Jiange;
	bool        wf_Is_Forbidden_CommPrompt;
	bool        wf_Is_Ok_Dialog;
	bool        wf_Is_ShowDXIdentity;

	_STRUCT_SYSTEM_PARA_INFO()
	{
		memset(default_file,0x0,250);
		wf_Is_wf_fac=TRUE;
		wfIS_Yangzhou_Model=FALSE;
		wf_manset_able=FALSE;
		wf_signboard_able=FALSE;
		wf_key_type=WF_KEY_TYPE_Contrl;
		wf_task_Only=FALSE;
		wf_Prompt_DownKey=TRUE;
		wf_Is_Limit_Jiange=FALSE;
		wf_Is_Forbidden_CommPrompt=FALSE;
		wf_Is_Ok_Dialog=FALSE;
		wf_Is_ShowDXIdentity=FALSE;
	}
}STRUCT_SYSTEM_PARA_INFO;

#pragma pack()

#endif // DEFINE_TICKET_H
